import {defineStore} from "pinia";
import {ref} from 'vue'
export const useSetting = defineStore('setting',() =>{



  // primitive数量
  const primitiveCount = ref(10000);
  function updatePrimitiveCount(count){
    primitiveCount.value = count;
  }

  // 是否显示Point
  const isShowPoint = ref(true)
  function updateIsShowPoint(show){
    isShowPoint.value = show
  }

  // 是否显示label
  const isShowLabel = ref(true)
  function  updateIsShowLable(show){
    isShowLabel.value = show
  }

  const isShowBillboard = ref(true)
  function updateIsShowBillboard(show){
    isShowBillboard.value = show
  }

  // 间隔更新频率
  const updateIntervalCount = ref(1);
  function changeUpdateIntervalCount(count){
    updateIntervalCount.value = count;
  }

  // 每帧移动的随机距离
  const moveRandomMin= ref(0)
  const moveRandomMax = ref(100)

  function updateMoveRandomMin (min){
    moveRandomMin.value = min
  }
  function updateMoveRandomMax(max){
    moveRandomMax.value = max;
  }

  // 抗锯齿
  const isShowFxaa = ref(true)
  function updateIsShowFxaa(show){
    isShowFxaa.value = show
  }

  return {
    primitiveCount,
    updatePrimitiveCount,

    isShowPoint,
    updateIsShowPoint,

    isShowLabel,
    updateIsShowLable,

    isShowBillboard,
    updateIsShowBillboard,

    updateIntervalCount,
    changeUpdateIntervalCount,

    moveRandomMin,moveRandomMax,
    updateMoveRandomMin,updateMoveRandomMax,


    isShowFxaa,updateIsShowFxaa
  }
},{
  persist: true,
})